export default function (data) {
  const result = []
  data.forEach(item=> {
    const [parentName, name] = item.name.split(':')
    const findItem = result.find(item=> item.parentName === parentName)
    if(findItem) {
      findItem.list.push({
        ...item,
        name: name
      })
    } else {
      result.push({
        parentName,
        list: [
          {
            ...item,
            name: name
          }
        ]
      })
    }
  })
  return result
}
